{extend name="$_admin_layout"}

{block name="tpl_vars"}
    {assign name="page_title" value="上传管理" /}
{/block}

{block name="main-content"}
    <form id="upload_list" class="table-form table-manager">
        <div class="box box-blue-hoki no-heading">
            <div class="box-body">

                <div class="row">
                    <div class="col-sm-12">
                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                                <tr>
                                    <th class="list-ids">{:helper('admin/table')->render_header_select()}</th>
                                    <th>{:helper('admin/table')->render_header_text('ID')}</th>
                                    <th>{:helper('admin/table')->render_header_text('名称')}</th>
                                    <th>{:helper('admin/table')->render_header_text('内容')}</th>
                                    <th>{:helper('admin/table')->render_header_text('类型')}</th>
                                    <th>{:helper('admin/table')->render_header_text('大小')}</th>
                                </tr>
                            </thead>
                            <tbody>
                                {notempty name="upload_list"}
                                    {foreach name="upload_list" item="vo"}
                                        <tr>
                                            <td>{:helper('admin/table')->render_column_select($vo['id'], array('selected' => $pagination['selected']))}</td>
                                            <td>{:helper('admin/table')->render_column_text($vo['id'])}</td>
                                            <td>{:helper('admin/table')->render_column_text($vo['name'])}</td>
                                            <td>
                                                <?php if (strpos($vo['path'], 'image') >= 0): ?>
                                                    <img class="thumb" src="__ROOT__{$vo.path}" />
                                                <?php else: ?>
                                                    &nbsp;
                                                <?php endif; ?>
                                            </td>
                                            <td>{:helper('admin/table')->render_column_text($vo['type'])}</td>
                                            <td>{:helper('admin/table')->render_column_text($vo['size'], array('format' => 'file_size'))}</td>
                                        </tr>
                                    {/foreach}
                                {else /}
                                    {:helper('admin/table')->render_empty_row()}
                                {/notempty}
                            </tbody>
                        </table>

                        {notempty name="upload_list"}
                            {:helper('admin/table')->render_pagination($pagination, $_controller->url('index', array('page' => '[page]')))}
                        {/notempty}
                    </div>
                </div>

            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </form>
{/block}
